<template>
  <div class="course-ecaluatelist pd16">
    <div
      class="course_ecaluatelist_item pd12 pt12"
      v-for="item in ecaluatelist"
      :key="item.id"
    >
      <img
        :src="item.avatar"
        @error="item.avatar=require('@/assets/icon/avatar.png')"
        class="explain_title_photo"
      />
      <div class="ecaluatelist_item_text">
        <div class="title_text_name">{{ item.person }}</div>
        <div class="item_text_time">{{ item.createTime }}</div>
        <van-rate v-model="item.skillStar" :size="10" color="#E8541E" :readonly='true' />
        <div class="course_explain_text">
          {{ item.commtent }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Rate from 'vant/lib/rate'
import 'vant/lib/rate/style'
import 'vant/lib/list/style'
export default {
	name: 'course-ecaluatelist',
	components: {
		VanRate: Rate,
	},
	props: {
		ecaluatelist: Array,
	},
	data() {
		return {
			value: 5,
			loading: false,
			finished: false,
		}
	},
	computed: {},
	created() {},
	mounted() {},
	methods: {
		onLoad() {
			// 异步更新数据
			// setTimeout 仅做示例，真实场景中一般为 ajax 请求
			setTimeout(() => {
				for (let i = 0; i < 10; i++) {
					this.list.push(this.list.length + 1)
				}

				// 加载状态结束
				this.loading = false

				// 数据全部加载完成
				if (this.list.length >= 40) {
					this.finished = true
				}
			}, 1000)
		},
	},
}
</script>

<style scoped lang="scss">
.course-ecaluatelist {
  width: 100%;
}
.course_ecaluatelist_item {
  width: 100%;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  justify-content: space-between;
}
.explain_title_photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: hsl(0, 0%, 0%);
  margin-right: 16px;
}
.ecaluatelist_item_text {
  width: calc(100% - 44px - 16px);
}
.item_text_time {
  font-size: 12px;
  line-height: 21px;
  color: #cccccc;
  opacity: 1;
}
.title_text_name {
  font-size: 17px;
  line-height: 24px;
}
.course_explain_text {
  width: 100%;
  font-size: 16px;
  line-height: 24px;
  color: #333;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
}
</style>
